<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(item,index) in type" :key="index">
                <input type="checkbox" v-model="checkedValue" :value="item">
                <div>{{item}}</div>
            </li>
        </ul>
        <button @click="all">全选</button>
        <button @click="notAll">全不选</button>
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data() {
                return {
                    checkedValue: [],
                    type: ['a', 'b', 'c', 'd']
                }
            },
            methods: {
                all:function(){
                    this.checkedValue = this.type ;
                },
                notAll:function(){
                    this.checkedValue = [] ;
                }
            }
        })
    </script>
</body>

</html>